package com.javaspeak.designpatterns.go4.behavioural.strategy;

/**
 * This interface is optional in the Stategy pattern. It provides a contract for
 * the appliction using the strategy pattern to swap in Strategies and execute
 * them.
 *
 * @author John Dickerson
 */
public class TriangleStrategy implements Strategy {

    /* (non-Javadoc)
     * @see com.javaspeak.designpatterns.go4.behavioural.strategy.
     *      Strategy#drawShape()
     */
    @Override
    public void drawShape() {

        StringBuilder sb = new StringBuilder( "\n" );
        sb.append( "    x    \n" );
        sb.append( "   x x   \n" );
        sb.append( "  x   x  \n" );
        sb.append( " x     x \n" );
        sb.append( "x x x x x\n" );

        System.out.println( sb.toString() );
    }
}
